/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Generation.Production.impl;

import EA_Model.IEC61970.Generation.Production.CostPerHeatUnit;
import EA_Model.IEC61970.Generation.Production.ProductionPackage;
import EA_Model.IEC61970.Generation.Production.ThermalGeneratingUnit;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Thermal Generating Unit</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.ThermalGeneratingUnitImpl#getOMCost <em>OM Cost</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ThermalGeneratingUnitImpl extends GeneratingUnitImpl implements ThermalGeneratingUnit {
	/**
	 * The cached value of the '{@link #getOMCost() <em>OM Cost</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getOMCost()
	 * @generated
	 * @ordered
	 */
	protected CostPerHeatUnit oMCost;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ThermalGeneratingUnitImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ProductionPackage.Literals.THERMAL_GENERATING_UNIT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CostPerHeatUnit getOMCost() {
		if (oMCost != null && oMCost.eIsProxy()) {
			InternalEObject oldOMCost = (InternalEObject)oMCost;
			oMCost = (CostPerHeatUnit)eResolveProxy(oldOMCost);
			if (oMCost != oldOMCost) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST, oldOMCost, oMCost));
			}
		}
		return oMCost;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CostPerHeatUnit basicGetOMCost() {
		return oMCost;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setOMCost(CostPerHeatUnit newOMCost) {
		CostPerHeatUnit oldOMCost = oMCost;
		oMCost = newOMCost;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST, oldOMCost, oMCost));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST:
				if (resolve) return getOMCost();
				return basicGetOMCost();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST:
				setOMCost((CostPerHeatUnit)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST:
				setOMCost((CostPerHeatUnit)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ProductionPackage.THERMAL_GENERATING_UNIT__OM_COST:
				return oMCost != null;
		}
		return super.eIsSet(featureID);
	}

} //ThermalGeneratingUnitImpl
